-
Notifications
You must be signed in to change notification settings - Fork 7
Rename old images refactor #11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
needs to be tested still, added the 3 changes from the task https://stfc.atlassian.net/browse/CLDSCRM-2987
I have coded all these changes and refactors for the task https://stfc.atlassian.net/browse/CLDSCRM-2987 Has not been tested yet in a dev environment so will test that tomorrow and re get pr if successful.
| with open('/etc/packer-utils/templates/rally-test.json') as templatejson: | ||
| testtemplate = json.load(templatejson) | ||
|
|
||
| testtemplate["VMTasks.boot_runcommand_delete"][0]["args"]["image"]["name"] = next_image_name | ||
|
|
||
| with open("/etc/packer-utils/tests/" + next_image_name + ".json", "w") as testFile: | ||
| with open(f"/etc/packer-utils/tests/{next_image_name}.json", "w") as testFile: | ||
| json.dump(testtemplate, testFile) | ||
|
|
||
| mailfilepath = "/tmp/" + next_image_name + "-" + DATE + ".mail" | ||
|
|
||
| test = cl("INSTANCENAME=Prod; rally db create ;rally deployment create --name $INSTANCENAME --filename /opt/rally/existing.json ;rally deployment check $INSTANCENAME ; /opt/rally/bin/rally deployment use Prod ; /opt/rally/bin/rally task start /etc/packer-utils/tests/" + next_image_name + ".json | grep \"rally task report\" | grep \"json\" | sed 's/output.json/\/tmp\/" + next_image_name + "-" + DATE + "\.json/g'") | ||
| test = cl(f"INSTANCENAME=Prod; rally db create ;rally deployment create --name $INSTANCENAME --filename /opt/rally/existing.json ;rally deployment check $INSTANCENAME ; /opt/rally/bin/rally deployment use Prod ; /opt/rally/bin/rally task start /etc/packer-utils/tests/{next_image_name}.json | grep \"rally task report\" | grep \"json\" | sed 's/output.json/\/tmp\/{next_image_name}-{DATE}\.json/g'") | ||
| print(test) | ||
| reportcmd = test.split("\\n\\t")[3].replace("\\n", "").replace("'", "").replace('"','') | ||
| print(reportcmd) | ||
| print("GENERATING NEW REPORT", flush=True) | ||
| #rint(test + " /tmp/"+next_image_name+"-"+DATE+".json") | ||
| #cl(test + " /tmp/"+next_image_name+"-"+DATE+".json") | ||
|
|
||
| cl(reportcmd) | ||
|
|
||
| with open("/tmp/" + next_image_name + "-" + DATE + ".json") as testresultjson: | ||
| with open(f"/tmp/{next_image_name}-{DATE}.json") as testresultjson: | ||
| testresult = json.load(testresultjson) | ||
|
|
||
| testPassed = testresult["tasks"][0]["pass_sla"] | ||
|
|
||
| if testPassed: | ||
| print(next_image_name) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can remove everything to do with rally. We will not use Rally to test the images as it is not very useful and we are making our own QA workflow
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When was that decision made? Do you have a draft of the tempest workflow?
|
|
||
| next_image_name = sys.argv[1] | ||
|
|
||
| current_image_name = next_image_name.replace("Next-", "") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
images are no longer called "Next-" instead it is "-baseline"
Refactored script and changed some inefficiencies with print formatting. Haven't yet tested so going to create dev image to test with, therefore I have left it in this branch for now till I test to merge to main.
https://stfc.atlassian.net/browse/CLDSCRM-2987
From this task, can the reviewer check the code. Review if the logic is right from the description of the task.